package ttOrder.model;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "food")
public class Food {
	private static final long serialVersionUID = -6530168542617015609L;
	@Id
	@GeneratedValue
	@Column(name = "ID", nullable = false)
	private Integer id;

	@Column(name = "FOODNAME", length = 1000, nullable = false)
	private String foodname;

	// @Column(name = "FOODTYPE_ID", length = 1000, nullable = false)
	// private Integer foodtypeId;

	@Column(name = "PRICE", length = 1000, nullable = false)
	private Float price;

	@Column(name = "MPRICE", length = 1000, nullable = false)
	private Float mprice;

	@Column(name = "REMARK", length = 1000, nullable = false)
	private String remark;

	@Column(name = "IMG", length = 1000, nullable = false)
	private String img;

	@ManyToOne(cascade = { CascadeType.DETACH, CascadeType.PERSIST, CascadeType.MERGE })
	@JoinColumn(name = "FOODTYPE_ID")
	private Foodtype foodtype;

	@OneToMany(mappedBy = "foodn")
	private Set<Order> order;

	public Food() {
		super();
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getFoodname() {
		return foodname;
	}

	public void setFoodname(String foodname) {
		this.foodname = foodname;
	}

	public Float getPrice() {
		return price;
	}

	public void setPrice(Float price) {
		this.price = price;
	}

	public Float getMprice() {
		return mprice;
	}

	public void setMprice(Float mprice) {
		this.mprice = mprice;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getImg() {
		return img;
	}

	public void setImg(String img) {
		this.img = img;
	}

	public Foodtype getFoodtype() {
		return foodtype;
	}

	public void setFoodtype(Foodtype foodtype) {
		this.foodtype = foodtype;
	}

	public Set<Order> getOrder() {
		return order;
	}

	public void setOrder(Set<Order> order) {
		this.order = order;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

}
